package com.sample.library;

import android.view.View;

public class ClickProxy implements View.OnClickListener {

    private final View.OnClickListener origin;
    private long lastclick = 0;


    public ClickProxy(View.OnClickListener origin) {
        this.origin = origin;
    }

    @Override
    public void onClick(View v) {
        if (System.currentTimeMillis() - lastclick >= 500) {
            origin.onClick(v);
            lastclick = System.currentTimeMillis();
        }
    }
}
